package cn.platform.controller;

import cn.platform.response.Result;
import cn.platform.response.TeacherOptionVO;
import cn.platform.service.TeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/teachers")
public class TeachersController {
    @Autowired
    TeacherService teacherService;

    /**
     * 展示所有老师姓名，同时也给对应的id
     * @return
     */
    @GetMapping("/all")
    public Result getAllTeachers() {
        log.info("获取老师列表信息");
        List<TeacherOptionVO> list = teacherService.getAllTeacherOptions();
        return Result.success(list);
    }

}
